package com.ymm.websocket.demo.rpc.impl;

import com.ymm.lulutong.dto.OrderShipperDTO;
import com.ymm.lulutong.service.ShipperProfileService;
import com.ymm.lulutong.utils.Result;
import com.ymm.websocket.demo.rpc.ShipperRPC;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component;

/**
 * @Description: 货主服务
 * @Author: Xuecheng Li
 * @CreateTime: 2022-08-14 16:33
 * @Version: 1.0.0
 */
@Component
public class ShipperRPCImpl implements ShipperRPC {

    @Reference(version = "server")
    ShipperProfileService shipperProfileService;

    /**
     * Result<OrderShipperDTO> getOrderShipperDTO(Long shipperId);
     *
     * @param shipperId
     * @Param: [shipperId]
     * @return: OrderShipperDTO
     */
    @Override
    public OrderShipperDTO getShipperInfo(Long shipperId) {
        Result<OrderShipperDTO> orderShipperDTOResult = shipperProfileService.getOrderShipperDTO(shipperId);
        OrderShipperDTO orderShipperDTO = orderShipperDTOResult.getData();

        return orderShipperDTO;
    }
}
